package com.vdong.restful.service;

import com.vdong.data.model.enums.State;
import com.vdong.restful.api.request.OrderInformationRequest;
import com.vdong.restful.api.request.TemplateRequest;
import com.vdong.restful.api.response.Response;
import org.springframework.data.domain.Pageable;

/**
 * 模板服务
 *
 * @author liangwei
 */
public interface TemplateApiService {

    /**
     * 验证shipper,支付方式cash时验证月结码。完成返回id
     * @param templateRequest
     * @param key
     * @return
     */
    Response add(TemplateRequest templateRequest, String key);

    Response findByUserId(String userId, Pageable pagebale, String key);

    Response findById(String templateId, String key);

    Response findByUserIdAndState(String userId, State state, String key);

    /**
     * 运费计算
     *
     * @param orderInformationRequest
     * @param key
     * @return
     */
    Response freight(OrderInformationRequest orderInformationRequest, String key);

    /**
     * 激活模板。该模板用户下的所有版本都只为不可用
     *
     * @param templateId
     * @return
     */
    Response saveTemplateStateById(String templateId, String key);

    Response deleteByStateAndId(String templateId, String key);
}
